package com.dom.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
//@EnableWebMvc
//@ComponentScan(value = "com.dom.domweb.controller")
public class WebMvcConf implements WebMvcConfigurer {
//    @Resource
//    private BaseInterceptor baseInterceptor;

//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor()
//                .excludePathPatterns("/css/**", "/image/**", "/js/**");
//    }

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        System.out.println("加载css样式路径");
        registry.addResourceHandler("/static/**").addResourceLocations("/static/");
//        registry.addResourceHandler("/js/**").addResourceLocations("classpath:/js/");
//        registry.addResourceHandler("/image/**").addResourceLocations("/image/");

//        WebMvcConfigurer.super.addResourceHandlers(registry);
    }

    @Override
    public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
        configurer.enable();
    }
}